﻿namespace Bango.WindowsPhone8.SDK
{
	public class BangoEvent
	{

		#region Properties, variables

		private System.DateTime _eventTime;
		private System.DateTime _eventLocalTime;

		public System.String ConnectionType { get; set; }
		public System.String ErrorId { get; set; }
		public System.Int32 ErrorLevel { get; set; }
		public System.String EventDetail { get; set; }
		public System.String EventName { get; set; }
		public System.String EventValue { get; set; }
		public System.String OperatorConnectionType { get; set; }
		public System.Boolean Posted { get; set; }

		public System.Int32 ProfileId { get; set; }
		public System.Int32 EventId { get; set; }

		public System.String EventLocalTime { get { return _eventLocalTime.ToString(BangoConstants.DATETIME_FORMAT); } set { _eventLocalTime = System.Convert.ToDateTime(value); } }
		public System.String EventTime { get { return _eventTime.ToString(BangoConstants.DATETIME_FORMAT); } set { _eventTime = System.Convert.ToDateTime(value); } }

		public System.Collections.Generic.List<BangoEventParameter> EventParameters { get; set; }

		#endregion

		internal void SetEventLocalTime(System.DateTime dte)
		{
			_eventLocalTime = dte;
		}

		internal void SetEventTime(System.DateTime dte)
		{
			_eventTime = dte;
		}

		internal BangoEvent()
		{
			EventParameters = new System.Collections.Generic.List<BangoEventParameter>();
		}

		internal BangoEvent(System.Int32 profileId, System.Int32 eventId, System.String connectionType, System.String operatorConnectionType, System.Int32 errorLevel, System.String eventName, System.String eventDetail, System.String eventValue, System.String errorId, System.DateTime eventTime, System.DateTime eventLocalTime, System.Collections.Generic.List<BangoEventParameter> eventParameters)
			: this()
		{
			ProfileId = profileId;
			EventId = eventId;
			ConnectionType = connectionType;
			OperatorConnectionType = operatorConnectionType;
			ErrorLevel = errorLevel;
			EventName = eventName;
			EventDetail = eventDetail;
			EventValue = eventValue;
			ErrorId = errorId;
			EventParameters = eventParameters;
			SetEventLocalTime(eventLocalTime);
			SetEventTime(eventTime);

		}

		internal BangoEvent(System.Int32 profileId, System.Int32 eventId, System.String connectionType, System.String operatorConnectionType, System.Int32 errorLevel, System.String eventName, System.String eventDetail, System.String eventValue, System.String errorId, System.String eventTime, System.String eventLocalTime, System.Collections.Generic.List<BangoEventParameter> eventParameters)
			: this()
		{
			ProfileId = profileId;
			EventId = eventId;
			ConnectionType = connectionType;
			OperatorConnectionType = operatorConnectionType;
			ErrorLevel = errorLevel;
			EventName = eventName;
			EventDetail = eventDetail;
			EventValue = eventValue;
			ErrorId = errorId;
			EventParameters = eventParameters;
			EventLocalTime = eventLocalTime;
			EventTime = eventTime;

		}
	}
}
